<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <i class="el-icon-s-unfold"></i>
        <span>数据列表</span>
        <router-link to="/admin/addTalent">
          <el-button style="float: right; padding: 3px 5px" type="text"
          >新增</el-button>
        </router-link>

        
      </div>

      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="num" label="序号" width="50"> </el-table-column>
        <el-table-column prop="name" label="姓名" width="150">
        </el-table-column>
        <el-table-column prop="position" label="应聘岗位" width="150">
        </el-table-column>
        <el-table-column prop="contact" label="联系方式" width="150">
        </el-table-column>
        <el-table-column prop="infoFrom" label="信息来源" width="150">
        </el-table-column>
        <el-table-column prop="feedback" label="面试反馈" width="107">
        </el-table-column>
        <el-table-column prop="peopleStatus" label="人员状态" width="150">
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <!-- <router-link to="'/updateTalent/'+scope.row.phone">
              <el-button @click="handleClick(scope.row)" type="text" size="small">修改</el-button>
            </router-link> -->

             <el-button @click="$router.push('/admin/updateTalent/'+scope.row.contact)" type="text" size="small">修改</el-button>


            <!-- <router-link to="/admin/seeTalent">
              <el-button type="text" size="small">查看</el-button>
            </router-link> -->

            <el-button @click="$router.push('/admin/seeTalent/'+scope.row.contact)" type="text" size="small">查看</el-button>

          </template>
        </el-table-column>
      </el-table>

      <div class="page">
        <el-pagination @current-change="changeFn" background layout="prev, pager, next" :total="200">
        </el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    handleClick(row) {
      console.log(row); 

    },
    async changeFn(page=1){
      console.log(666);
       let ret = await this.$store.dispatch('talent/taListAction',2)
    console.log(ret);
    console.log(this.$store.state.talent.talentList);
    this.tableData = this.$store.state.talent.talentList
    }
  },
async mounted() {
    // 获取列表
  this.changeFn()
  },
  

  
};
</script>

<style lang="scss" scoped>
.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}

.box-card {
  width: 1050px;
  margin: 20px 10px;
  //    background-color: #f2f2f2;
}
.page{
  height: 40px;
  padding: 10px;
  margin-left: 600px;
}
</style>